﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace OblivionLevelingHelper.Skills
{
    public class SkillSet
    {
        private readonly Character _parent;
        private readonly Dictionary<SkillTypes, Skill> _skills;

        public SkillSet(Character parent)
        {
            // Set the parent Character
            _parent = parent;

            // Configure all skills
            _skills = new Dictionary<SkillTypes, Skill>();
            foreach (SkillTypes skill in Enum.GetValues(typeof(SkillTypes)))
            {
                Add(skill);
            }
        }

        public void Add(SkillTypes skillType)
        {
            _skills.Add(skillType, new Skill(skillType, _parent));
        }

        public Skill GetSkill(SkillTypes skillType)
        {
            return _skills[skillType];
        }

        public List<Skill> GetSkills()
        {
            return _skills.Values.ToList();
        }
    }
}
